package com.dg.param;


import lombok.Builder;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Builder
public class RoleParam {

    private Integer id;

    @NotBlank(message = "角色名称不能为空")
    @Length(min = 1, max = 20, message = "角色名长度需要在1~20之间")
    private String name;

    @Min(value = 1, message = "角色类型参数最小为1")
    @Max(value = 2, message = "角色类型参数最大为2")
    @NotNull(message = "角色类型不能为空")
    private Integer type;

    @Min(value = 0, message = "状态最小为0")
    @Max(value = 2, message = "状态最大为2")
    @NotNull(message = "状态不能为空")
    private Integer status;

    @Length(max = 200, message = "备注长度必须在200个字之内")
    private String remark;

}
